<template>
  <el-checkbox-button v-if="display=='button'"
                      v-bind="$myProps"
                      v-on="$myListeners">
    <slot></slot>
  </el-checkbox-button>
  <el-checkbox v-else
               v-bind="$myProps"
               v-on="$myListeners">
    <slot></slot>
  </el-checkbox>
</template>

<script>
export default {
  props: {
    value: [String, Number, Boolean],
    display: {
      type: String,
      default: "checkbox",
    },
  },
  computed: {
    $myProps() {
      return this.$public.inheritProps(this);
    },
    $myListeners() {
      return this.$public.inheritListeners(this);
    },
  },
  mounted() {
    this.$emit("mounted");
  },
  created() {
    this.$emit("created");
  },
};
</script>